<template>
    <div class="column-block-warp">
        <img class="left-fill" :src="colImage"/>

        <div class="right-fill">
            <div class="col-title">
                {{ getSubStringText(colTitle,10) }}
            </div>
            <div class="col-content" v-html="getSubStringText(colContent,75)">{{ getSubStringText(colContent,75) }}</div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "ColumnBlock",
        props:{
            colImage:{
                type:String,
                default:'',
                required:false
            },
            colContent:{
                type:String,
                default:'',
                required:false
            },
            colTitle:{
                type:String,
                required:false,
                default:''
            }
        },
        methods:{
            getSubStringText(text,len){
                if(!text || text.length==0){
                    return ''
                }
                if(text.length<len){
                    return text;
                }
                return text.substr(0,len)+"..."
            }
        }
    }
</script>

<style scoped lang="less">
    .column-block-warp {
        position: relative;
        display: inline-block;
        width: 100%;
        padding: 0.2rem 0;
        vertical-align: top;
    .left-fill {
        position:absolute;
        top: 0;
        width: 5rem;
        display: inline-block;
    }

    .right-fill {
        width: calc(100% - 5rem);
        position:absolute;
        margin-left:7rem;
    .col-content {
        font-size: 1rem;
        line-height: 1.1rem;
        width: 100%;
    }

    .col-title {
        font-size: 1rem;
        font-weight: bold;
        width: 100%;
        color: #333 !important;
        margin-top: -1.5rem
    }

    }
    }

</style>